package com.openbravo.pos.printer;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;

public class DeviceDisplayBase
{
  public static final int ANIMATION_NULL = 0;
  public static final int ANIMATION_FLYER = 1;
  public static final int ANIMATION_SCROLL = 2;
  public static final int ANIMATION_BLINK = 3;
  public static final int ANIMATION_CURTAIN = 4;
  private DeviceDisplayImpl impl;
  private DisplayAnimator anim;
  private Timer m_tTimeTimer;
  private int counter = 0;

  public DeviceDisplayBase(DeviceDisplayImpl paramDeviceDisplayImpl)
  {
    this.impl = paramDeviceDisplayImpl;
    this.anim = new NullAnimator("", "");
    this.m_tTimeTimer = new Timer(50, new PrintTimeAction());
  }

  public void writeVisor(int paramInt, String paramString1, String paramString2)
  {
    this.m_tTimeTimer.stop();
    switch (paramInt)
    {
    case 1:
      this.anim = new FlyerAnimator(paramString1, paramString2);
      break;
    case 2:
      this.anim = new ScrollAnimator(paramString1, paramString2);
      break;
    case 3:
      this.anim = new BlinkAnimator(paramString1, paramString2);
      break;
    case 4:
      this.anim = new CurtainAnimator(paramString1, paramString2);
      break;
    default:
      this.anim = new NullAnimator(paramString1, paramString2);
    }
    this.counter = 0;
    this.anim.setTiming(this.counter);
    this.impl.repaintLines();
    if (paramInt != 0)
    {
      this.counter = 0;
      this.m_tTimeTimer.start();
    }
  }

  public void writeVisor(String paramString1, String paramString2)
  {
    writeVisor(0, paramString1, paramString2);
  }

  public void clearVisor()
  {
    writeVisor(0, "", "");
  }

  public String getLine1()
  {
    return this.anim.getLine1();
  }

  public String getLine2()
  {
    return this.anim.getLine2();
  }

  private class PrintTimeAction
    implements ActionListener
  {
    private PrintTimeAction()
    {
    }

    public void actionPerformed(ActionEvent paramActionEvent)
    {
    	//ati
   //   DeviceDisplayBase.access$108(DeviceDisplayBase.this);
      DeviceDisplayBase.this.anim.setTiming(DeviceDisplayBase.this.counter);
      DeviceDisplayBase.this.impl.repaintLines();
    }
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.printer.DeviceDisplayBase
 * JD-Core Version:    0.6.0
 */